home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 301-325 / disk_313 / uucp / uucp1.lzh / man / DCron < prev    next >
Text File  |  1989-10-27  |  5KB  |  132 lines

  1.  
  2.                 DCRON.DOC
  3.  
  4.                   UNIX-like CRON
  5.  
  6.                   V2.00
  7.                   7 August 1989
  8.  
  9.                   Matthew Dillon
  10.                   891 Regal Rd
  11.                   Berkeley, Ca. 94708
  12.  
  13.                  dillon@ucbvax.Berkeley.edu
  14.                  ...!ucbvax!dillon
  15.  
  16. DESCRIPTION:
  17.  
  18.     Those not familar with the UNIX cron command probably do not need it.
  19.  
  20.  
  21. INSTALLATION:
  22.     the NULL: device must be mounted
  23.  
  24.     an s:crontab file must exist (see instructions below)
  25.  
  26.     1.3 RUN required so you can: run <nil: >nil: dcron <logfile>
  27.  
  28.     copyadd l/null-handler into your l: and add the appropriate
  29.     Mountlist entry to your devs:Mountlist (see included Mountlist
  30.     file)
  31.  
  32.     Create S:crontab with entries as you like.
  33.  
  34. INSTRUCTIONS:
  35.  
  36.     NOTE:   * All cron-commands are automatically RUN  in the background,
  37.           you do not need to say 'run' in the command argument of the
  38.           s:crontab file
  39.  
  40.         * You do not have to redirect standard command output.  I.E.
  41.           if you do a 'List' from cron, the output is sent to the
  42.           cia.
  43.  
  44.         * DCRON WORKS ONLY WITH 1.3, specifically, the 1.3 RUN command
  45.           must be installed.
  46.  
  47.         * DO NOT RUNBACK CRON!!!  Use: run <nil: >nil:
  48.  
  49.  
  50.     Inspired by Rick Schaeffer's AmigaCron.  I decided to write this
  51. one from scratch.  The program is crontab file compatible with Rick's
  52. and the UNIX cron tab format with the same exceptions as Rick had.
  53. Specifically, the % char is not implemented and the day-of-week is
  54. ranged 0-6 (Sun-Sat) rather than the UNIX 1-7 (Mon-Sun).
  55.  
  56.  
  57.     The major purpose of this program, apart from yielding the functionality
  58. of cron, is the addition of major time optimizations.  The program loads
  59. s:crontab into memory and only reloads if the datestamp of the file has been
  60. modified (checked every 60 seconds).  DCron also checks if the user has
  61. modified the system time.
  62.  
  63.     The result is that my cron takes virtually no CPU.
  64.  
  65.     [run <nil: >nil:] DCron [-d] logfile
  66.  
  67.     Using the 1.3 RUN command and redirecting both stdin and stdout to NIL:,
  68.     you can safely close the CLI window that you ran DCron in.
  69.  
  70.     The logfile is a required argument and logs all errors and status
  71. messages.  Under normal conditions this file does not get very big.
  72. Cron does an open-append/write/close sequence every time it logs a message
  73. allowing you to cat, edit, or even remove the file with cron running.
  74. (If you remove it, the next logged message will cause the file to be
  75. re-created).
  76.  
  77.     The -d option, for debug, is used for debugging and logs additional
  78. information.  (may not be implemented in release)
  79.  
  80.     The control file is S:CRONTAB and may contain one of three types of
  81. lines:    (1) A blank line, (2) A line beginning with a hash ``#'' which
  82. introduces a comment, (3) A cron line of 5 or 6 fields:
  83.  
  84. <min> <hour> <day> <month> <dayofweek>    [<command>]
  85.  
  86.     Each field <min> to <dayofweek> can be either a single asterix ``*''
  87. which matches all times, or a comma delimited list of numbers or ranges
  88. which must be in numerical order.  Assume the control file is scanned
  89. every minute.  On every minute, each field that matches the current
  90. time, day, and day of week will be executed.
  91.  
  92.     The <command> field is optional.  If no command is given the date is
  93. simply logged to the logfile (as well as the cron line that caused it).
  94. If a command is given, it is a CLI command and is automatically RUN
  95. (asynchronous from the cron task).  Standard in/out is NIL:  The cron line
  96. that ran the command is logged.
  97.  
  98. * * * * *   Date
  99.  
  100.     Would execute the Date command every minute.  The output is ignored.
  101.     I.E. useless.  Also, running something every minute wastes CPU.
  102.  
  103. 0-3,5,7,40-50 * * * *    Date
  104.  
  105.     Would execute it at the hour, 1 past, 2 past, 3 past, 5 past, 7 past,
  106.     40 41 42 ... and 50 past every hour.  Combinations can be used to
  107.     yield more interesting results:
  108.  
  109. 0 0,12 * * 0    Date
  110.  
  111.     Would run Date at midnight and 12 noon, but only on sunday.
  112.  
  113. 0 0 25 12 *    Echo >ram:x "Merry Cristmas"
  114.  
  115.     Would execute the Echo command at midnight beginning christmas day and
  116.     stick it in ram:x.
  117.  
  118. * * * * 2-3 Date
  119.  
  120.     Is useless ... execute the Date command every minute but only if the
  121.     day is a tuesday or wednesday (i.e. 1440 times on tuesday, 1440
  122.     times on wednesday, nothing for any other day).
  123.  
  124. 0 4 * * 1     shell >ram:backups -c "ChangeTaskPri -1;dobackups"
  125.  
  126.     Would run a shell script to do my HD backup at 4:00 A.M. every Monday.
  127. (I have the advantage of having two physical drives and can back one up
  128. to the other without user intervention).  This would also be useful to
  129. backup something to a remote host if you are on a network.
  130.  
  131.  
  132.